package com.therandoms.rtgdroid.background;

import org.jpaste.pastebin.Pastebin;
import org.jpaste.pastebin.PastebinPaste;

import android.os.AsyncTask;

/**
 * A simple AsyncTask for pastebin. The api key should be params[0], and the text should be params[1]
 * @author logan
 *
 */
public class PastebinAsyncTask extends AsyncTask<String, String, String>{

	@Override
	protected String doInBackground(String... params) {
		
		try{
			PastebinPaste mPaste = Pastebin.newPaste(params[0], params[1]);
			return mPaste.paste().getLink().toString();
		}
		catch(Exception e){
			return null;
		}
	}
	

}
